import Vue from 'vue';
import VueI18n from 'vue-i18n';
import Cookie from 'js-cookie';
import ElementZh from 'element-ui/lib/locale/lang/zh-CN';
import ElementEn from 'element-ui/lib/locale/lang/en';
import CustomZh from './zh';
import CustomEn from './en';

Vue.use(VueI18n);

export default new VueI18n({
  locale: Cookie.get('lang') || 'zh',
  messages: {
    zh: {
      ...ElementZh,
      ...CustomZh,
    },
    en: {
      ...ElementEn,
      ...CustomEn,
    },
  },
});
